// pages/index/Share/ShareHotMoney.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    userInfo:[],
    addPic:[],
    originalWidth:'',
    originalHeight: ''
  },
 
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that  = this;
    console.log(options)
    that.setData({
      userInfo: app.globalData.userInfo,
      addPic: options.addPic,
    })
  },
  toshareChat:function(){
    
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },
  PicDetail:function(){
    var that = this;
    wx.previewImage({
      urls: [that.data.addPic],
    })
    that.widthHeight(that.data.addPic);
  },
  toyouxi:function(){
    var that = this;
    wx.navigateTo({
      url: './game?addpic=' + that.data.addPic + "&originalWidth=" + that.data.originalWidth
      + "&originalHeight=" + that.data.originalHeight,

    })
  },
  widthHeight:function(e){
    var that = this;
    wx.getImageInfo({
      src: e,
      success: function (res) {
        console.log(res)
        that.setData({
          originalWidth:res.width,
          originalHeight:res.height
        })
      }
    })
  },


  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})